package models;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import play.db.jpa.Model;

@Entity
@Table(name = "indent")
public class Indent extends Model {

	
/*	订单信息表ID   ind_id 
	系统参数配置表ID  sys_id 
	会员id  mem_id 
	订单号   ind_num 
	收书人   ind_con 
	收书地址   ind_addr 
	收书人电话   ind_mob 
	订单状态   ind_sta 
	订单处理者   ind_proc*/ 
	 
	@Column(name="sys_id",length=50)
	public String sysid; 
	//收书人城市
	public String indcity;
	//收书人固定电话
	public String indtel;
	
	public Date cdate;
	
	@Column(name="mem_id",length=50)
	public String memid; 
	
	@Column(name="ind_num",length=50,unique=true)
	public String indnum; 
	
	@Column(name="ind_con",length=50)
	public String indcon; 
	
	@Column(name="ind_addr",length=150)
	public String indaddr; 
	
	@Column(name="ind_mob",length=50)
	public String indmob; 
	
	@Column(name="ind_sta")
	public Integer indsta; //0未处理,1处理中2已发货3未发货4已取消5已付款6.续借
	
	@Column(name="ind_proc",length=50)
	public String indproc; 
	
	@OneToMany(fetch = FetchType.LAZY,mappedBy="indent")
	public Set<Borrow> borrows = new HashSet<Borrow>(0);
	
	@OneToOne(fetch = FetchType.LAZY,mappedBy="indent")
	public Express express;
	
}
